Class: Github::API::Config::Property
- Inherits:
-
Object
- Object
- Github::API::Config::Property
- Defined in:
- lib/github_api2/api/config/property.rb
Overview
Property objects provide an interface for configuration options
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
Instance Method Summary collapse
- #define_accessor_methods(properties) ⇒ Object private
-
#initialize(name, options) ⇒ Property
constructor
A new instance of Property.
Constructor Details
#initialize(name, options) ⇒ Property
Returns a new instance of Property.
14 15 16 17 18 19 |
# File 'lib/github_api2/api/config/property.rb', line 14 def initialize(name, ) @name = name @default = .fetch(:default, nil) @required = .fetch(:required, nil) @options = end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
11 12 13 |
# File 'lib/github_api2/api/config/property.rb', line 11 def default @default end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/github_api2/api/config/property.rb', line 10 def name @name end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
12 13 14 |
# File 'lib/github_api2/api/config/property.rb', line 12 def required @required end |
Instance Method Details
#define_accessor_methods(properties) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 25 |
# File 'lib/github_api2/api/config/property.rb', line 22 def define_accessor_methods(properties) properties.define_reader_method(self, self.name, :public) properties.define_writer_method(self, "#{self.name}=", :public) end |