siba_api 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7bbba86823deead2120faa71d5277a25da5a1e4ca99b9b1c60f25fb7fda70678
4
+ data.tar.gz: cc0f1f091f4deae42e93d167b56e6704f4df42caf5bbf91933f0e50e8afd75a3
5
+ SHA512:
6
+ metadata.gz: 1f452bf2a48e5b6af0cd9b1d7abea1633d495350b8063a19a48c24be246f9fc6ee13ea9cb05f0a34b01784e8bc7cf830696c9879c169bf6723ff18101cc822da
7
+ data.tar.gz: fe4feceba7c8f50a01582aecc811b9ae7bbc080425dfad1b9005023ee31f97e16e03af17e8304da0089f83f3cc60c70d57aeadd789f0c6894a266eec472d3781
@@ -0,0 +1,18 @@
1
+ name: Ruby
2
+
3
+ on: [push,pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: 3.0.0
14
+ - name: Run the default task
15
+ run: |
16
+ gem install bundler -v 2.2.3
17
+ bundle install
18
+ bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ # project files
14
+ /.idea/
15
+ fantasticstay_api.iml
16
+
17
+ # custom ignores
18
+ .env
data/.irbrc ADDED
@@ -0,0 +1,5 @@
1
+ require 'irb'
2
+ require 'irb/completion'
3
+ require 'rubygems'
4
+ require 'pp'
5
+ IRB.conf[:SAVE_HISTORY] = 300
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ Style/StringLiterals:
2
+ Enabled: true
3
+ EnforcedStyle: single_quotes
4
+
5
+ Style/StringLiteralsInInterpolation:
6
+ Enabled: true
7
+ EnforcedStyle: double_quotes
8
+
9
+ Layout/LineLength:
10
+ Max: 120
11
+
12
+ AllCops:
13
+ TargetRubyVersion: 2.4.0
14
+ NewCops: enable
data/CHANGELOG.md ADDED
File without changes
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Dockerfile ADDED
@@ -0,0 +1,11 @@
1
+ FROM ruby:3.0
2
+
3
+ WORKDIR /usr/src/app
4
+
5
+ COPY Gemfile .
6
+ COPY Gemfile.lock .
7
+ COPY siba_api.gemspec .
8
+ COPY lib/siba_api/version.rb ./lib/siba_api/version.rb
9
+ RUN bundle install
10
+
11
+ COPY . .
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in siba_api.gemspec
6
+ gemspec
7
+
8
+ gem 'dotenv', '~> 2.7'
9
+
10
+ group :test do
11
+ gem 'rake', '~> 13.0'
12
+ gem 'rspec', '~> 3.0'
13
+ gem 'rubocop', '~> 0.80'
14
+ gem 'vcr', '~> 6.0'
15
+ gem 'webmock', '~> 3.12'
16
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,107 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ siba_api (0.1.0)
5
+ gyoku (~> 1.0)
6
+ savon (~> 2.12)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ addressable (2.7.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
13
+ akami (1.3.1)
14
+ gyoku (>= 0.4.0)
15
+ nokogiri
16
+ ast (2.4.2)
17
+ builder (3.2.4)
18
+ crack (0.4.5)
19
+ rexml
20
+ diff-lcs (1.4.4)
21
+ dotenv (2.7.6)
22
+ gyoku (1.4.0)
23
+ builder (>= 2.1.2)
24
+ rexml (~> 3.0)
25
+ hashdiff (1.0.1)
26
+ httpi (2.5.0)
27
+ rack
28
+ socksify
29
+ mail (2.7.1)
30
+ mini_mime (>= 0.1.1)
31
+ mini_mime (1.1.2)
32
+ nokogiri (1.13.8-aarch64-linux)
33
+ racc (~> 1.4)
34
+ nokogiri (1.13.8-x86_64-linux)
35
+ racc (~> 1.4)
36
+ nori (2.6.0)
37
+ parallel (1.20.1)
38
+ parser (3.0.0.0)
39
+ ast (~> 2.4.1)
40
+ public_suffix (4.0.6)
41
+ racc (1.6.0)
42
+ rack (2.2.4)
43
+ rainbow (3.0.0)
44
+ rake (13.0.3)
45
+ regexp_parser (2.1.1)
46
+ rexml (3.2.4)
47
+ rspec (3.10.0)
48
+ rspec-core (~> 3.10.0)
49
+ rspec-expectations (~> 3.10.0)
50
+ rspec-mocks (~> 3.10.0)
51
+ rspec-core (3.10.1)
52
+ rspec-support (~> 3.10.0)
53
+ rspec-expectations (3.10.1)
54
+ diff-lcs (>= 1.2.0, < 2.0)
55
+ rspec-support (~> 3.10.0)
56
+ rspec-mocks (3.10.2)
57
+ diff-lcs (>= 1.2.0, < 2.0)
58
+ rspec-support (~> 3.10.0)
59
+ rspec-support (3.10.2)
60
+ rubocop (0.93.1)
61
+ parallel (~> 1.10)
62
+ parser (>= 2.7.1.5)
63
+ rainbow (>= 2.2.2, < 4.0)
64
+ regexp_parser (>= 1.8)
65
+ rexml
66
+ rubocop-ast (>= 0.6.0)
67
+ ruby-progressbar (~> 1.7)
68
+ unicode-display_width (>= 1.4.0, < 2.0)
69
+ rubocop-ast (1.4.1)
70
+ parser (>= 2.7.1.5)
71
+ ruby-progressbar (1.11.0)
72
+ savon (2.13.0)
73
+ akami (~> 1.2)
74
+ builder (>= 2.1.2)
75
+ gyoku (~> 1.2)
76
+ httpi (>= 2.4.5)
77
+ mail (~> 2.5)
78
+ nokogiri (>= 1.8.1)
79
+ nori (~> 2.4)
80
+ wasabi (~> 3.4)
81
+ socksify (1.7.1)
82
+ unicode-display_width (1.7.0)
83
+ vcr (6.0.0)
84
+ wasabi (3.7.0)
85
+ addressable
86
+ httpi (~> 2.0)
87
+ nokogiri (>= 1.4.2)
88
+ webmock (3.12.2)
89
+ addressable (>= 2.3.6)
90
+ crack (>= 0.3.2)
91
+ hashdiff (>= 0.4.0, < 2.0.0)
92
+
93
+ PLATFORMS
94
+ aarch64-linux
95
+ x86_64-linux
96
+
97
+ DEPENDENCIES
98
+ dotenv (~> 2.7)
99
+ rake (~> 13.0)
100
+ rspec (~> 3.0)
101
+ rubocop (~> 0.80)
102
+ siba_api!
103
+ vcr (~> 6.0)
104
+ webmock (~> 3.12)
105
+
106
+ BUNDLED WITH
107
+ 2.2.33
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 TODO: Write your name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # SIBA API Wrapper
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library
4
+ into a gem. Put your Ruby code in the file `lib/siba_api`. To experiment with that code, run `bin/console` for an
5
+ interactive prompt.
6
+
7
+ TODO: Delete this and the text above, and describe your gem
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'siba_api'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle install
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install siba_api
24
+
25
+ ## Usage
26
+
27
+ TODO: Write usage instructions here
28
+
29
+ ## Examples
30
+
31
+ ```ruby
32
+ siba = SIBAApi.new(wsdl: 'https://siba.sef.pt/bawsdev/boletinsalojamento.asmx?wsdl', hotel_unit: '121212121', establishment: '00', access_key: '999999999')
33
+ r = siba.deliver_bulletins(123, [{ surname: 'Surname', name: 'Name', nationality: 'VEN', birthdate: '199
34
+ 9-01-01T00:00:00', place_of_birth: 'Place of Birth', id_document: '123456789', document_country: 'YEM', document_type: 'P
35
+ ', origin_country: 'USA', start_date: '2022-08-01T00:00:00', end_date: '2022-08-31T00:00:00', origin_place: 'Place of Res
36
+ idence', }])
37
+ ```
38
+
39
+ ## Development
40
+
41
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can
42
+ also run `bin/console` for an interactive prompt that will allow you to experiment.
43
+
44
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the
45
+ version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,
46
+ push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
47
+
48
+ ## Contributing
49
+
50
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dlage/siba_api. This project is
51
+ intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
52
+ the [code of conduct](https://github.com/dlage/siba_api/blob/master/CODE_OF_CONDUCT.md).
53
+
54
+ ## License
55
+
56
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
57
+
58
+ ## Code of Conduct
59
+
60
+ Everyone interacting in the SEF_API project's codebases, issue trackers, chat rooms and mailing lists is expected to
61
+ follow the [code of conduct](https://github.com/dlage/siba_api/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/SEFRootCA.zip ADDED
Binary file
data/bin/console ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'dotenv/load'
6
+ require 'siba_api'
7
+
8
+ # You can add fixtures and/or initialization code here to make experimenting
9
+ # with your gem easier. You can also use a different console, if you like.
10
+
11
+ # (If you use this, don't forget to add pry to your Gemfile!)
12
+ # require "pry"
13
+ # Pry.start
14
+
15
+ require 'irb'
16
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,7 @@
1
+ version: "3.9"
2
+ services:
3
+ app:
4
+ build: .
5
+ command: bash -c "rake"
6
+ volumes:
7
+ - .:/usr/src/app
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SIBAApi
4
+ class API
5
+ class Config
6
+ # Property objects provide an interface for configuration options
7
+ class Property
8
+ attr_reader :name, :default, :required
9
+
10
+ def initialize(name, options)
11
+ @name = name
12
+ @default = options.fetch(:default, nil)
13
+ @required = options.fetch(:required, nil)
14
+ @options = options
15
+ end
16
+
17
+ # @api private
18
+ def define_accessor_methods(properties)
19
+ properties.define_reader_method(self, name, :public)
20
+ properties.define_writer_method(self, "#{name}=", :public)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,119 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'set'
4
+
5
+ module SIBAApi
6
+ class API
7
+ class Config
8
+ # Class responsible for storing configuration properties
9
+ class PropertySet
10
+ include Enumerable
11
+
12
+ attr_reader :parent, :properties
13
+
14
+ # Initialize an PropertySet
15
+ #
16
+ # @param [Object] parent
17
+ # @param [Set] properties
18
+ #
19
+ # @return [undefined]
20
+ #
21
+ # @api private
22
+ def initialize(parent = nil, properties = Set.new)
23
+ @parent = parent
24
+ @properties = properties
25
+ @map = {}
26
+ end
27
+
28
+ # Iterate over properties
29
+ #
30
+ # @yield [property]
31
+ #
32
+ # @yieldparam [Property] property
33
+ #
34
+ # @return [self]
35
+ #
36
+ # @api public
37
+ def each
38
+ return to_enum unless block_given?
39
+
40
+ @map.each { |name, property| yield property if name.is_a?(Symbol) }
41
+ self
42
+ end
43
+
44
+ # Adds property to the set
45
+ #
46
+ # @example
47
+ # properties_set << property
48
+ #
49
+ # @param [Property] property
50
+ #
51
+ # @return [self]
52
+ #
53
+ # @api public
54
+ def <<(property)
55
+ properties << property
56
+ update_map(property.name, property.default)
57
+ property.define_accessor_methods(self)
58
+ self
59
+ end
60
+
61
+ # Access property by name
62
+ #
63
+ # @api public
64
+ def [](name)
65
+ @map[name]
66
+ end
67
+ alias fetch []
68
+
69
+ # Set property value by name
70
+ #
71
+ # @api public
72
+ def []=(name, property)
73
+ update_map(name, property)
74
+ end
75
+
76
+ # Update map with index
77
+ #
78
+ # @api private
79
+ def update_map(name, property)
80
+ @map[name.to_sym] = @map[name.to_s.freeze] = property
81
+ end
82
+
83
+ # Convert properties to a hash of property names and
84
+ # corresponding values
85
+ #
86
+ # @api public
87
+ def to_hash
88
+ properties.each_with_object({}) do |property, props|
89
+ name = property.name
90
+ props[name] = self[name]
91
+ end
92
+ end
93
+
94
+ # Check if properties exist
95
+ #
96
+ # @api public
97
+ def empty?
98
+ @map.empty?
99
+ end
100
+
101
+ # @api private
102
+ def define_reader_method(property, method_name, visibility)
103
+ property_set = self
104
+ parent.send(:define_method, method_name) { property_set[property.name] }
105
+ parent.send(visibility, method_name)
106
+ end
107
+
108
+ # @api private
109
+ def define_writer_method(property, method_name, visibility)
110
+ property_set = self
111
+ parent.send(:define_method, method_name) do |value|
112
+ property_set[property.name] = value
113
+ end
114
+ parent.send(visibility, method_name)
115
+ end
116
+ end
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,101 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'config/property'
4
+ require_relative 'config/property_set'
5
+
6
+ module SIBAApi
7
+ class API
8
+ # A base class for constructing api configuration
9
+ class Config
10
+ # Defines a property on an object's class or instance
11
+ #
12
+ # @example
13
+ # class Configuration < Api::Config
14
+ # property :adapter, default: :net_http
15
+ # property :user, required: true
16
+ # end
17
+ #
18
+ # @param [Symbol] name
19
+ # the name of a property
20
+ #
21
+ # @param [#to_hash] options
22
+ # the extra options
23
+ #
24
+ # @return [self]
25
+ #
26
+ # @api public
27
+ def self.property(name, options = {})
28
+ property_set << Property.new(name, options)
29
+ update_subclasses(name, options)
30
+ self
31
+ end
32
+
33
+ def self.update_subclasses(name, options)
34
+ @subclasses.each { |klass| klass.property(name, options) } if defined?(@subclasses) && @subclasses
35
+ end
36
+
37
+ # Check if property is defined
38
+ #
39
+ # @param [Symbol] name
40
+ # the name to check
41
+ #
42
+ # @return [Boolean]
43
+ #
44
+ # @api public
45
+ def self.property?(name)
46
+ property_set.include?(name)
47
+ end
48
+
49
+ class << self
50
+ attr_reader :property_set
51
+ end
52
+
53
+ instance_variable_set('@property_set', PropertySet.new(self))
54
+
55
+ def self.inherited(descendant)
56
+ super
57
+ (@subclasses ||= Set.new) << descendant
58
+ descendant.instance_variable_set(
59
+ '@property_set',
60
+ PropertySet.new(descendant, property_set.properties.dup)
61
+ )
62
+ end
63
+
64
+ def property_names
65
+ self.class.property_set.properties.map(&:name)
66
+ end
67
+
68
+ def self.property_names
69
+ property_set.properties.map(&:name)
70
+ end
71
+
72
+ # Fetch all the properties and their values
73
+ #
74
+ # @return [Hash[Symbol]]
75
+ #
76
+ # @api public
77
+ def fetch(value = nil)
78
+ if value
79
+ self.class.property_set[value]
80
+ else
81
+ self.class.property_set.to_hash
82
+ end
83
+ end
84
+
85
+ # Provide access to properties
86
+ #
87
+ # @example
88
+ # config.call do |config|
89
+ # config.adapter = :net_http
90
+ # end
91
+ #
92
+ # @return [self]
93
+ #
94
+ # @api private
95
+ def call(&block)
96
+ block.call(self) if block_given?
97
+ self
98
+ end
99
+ end
100
+ end
101
+ end