A base class for constructing api configuration
Classes:Property,PropertySet
Returns the value of attribute property_set.
Defines a property on an object’s class or instance.
Check if property is defined.
Provide access to properties.
Fetch all the properties and their values.
A new instance of Config.
Returns a new instance of Config.
646566 | # File 'lib/github_api/api/config.rb', line 64definitialize(&block)super(&block)end |
Returns the value of attribute property_set.
525354 | # File 'lib/github_api/api/config.rb', line 52defproperty_set@property_setend |
575859606162 | # File 'lib/github_api/api/config.rb', line 57defself.inherited(descendant)super(@subclasses||=Set.new)<<descendantdescendant.instance_variable_set('@property_set',PropertySet.new(descendant,self.property_set.properties.dup))end |
Defines a property on an object’s class or instance
classConfiguration<Api::Configproperty:adapter,default::net_httpproperty:user,required:trueendParameters:
the name of a property
the extra options
Returns:
2728293031 | # File 'lib/github_api/api/config.rb', line 27defself.property(name,={})self.property_set<<Property.new(name,)update_subclasses(name,)selfend |
Check if property is defined
Parameters:
the name to check
Returns:
474849 | # File 'lib/github_api/api/config.rb', line 47defself.property?(name)property_set.include?(name)end |
727374 | # File 'lib/github_api/api/config.rb', line 72defself.property_namesproperty_set.properties.map(&:name)end |
3334353637 | # File 'lib/github_api/api/config.rb', line 33defself.update_subclasses(name,)ifdefined?(@subclasses)&&@subclasses@subclasses.each{|klass|klass.property(name,)}endend |
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.
Provide access to properties
config.calldo|config|config.adapter=:net_httpendReturns:
99100101102 | # File 'lib/github_api/api/config.rb', line 99defcall(&block)block.call(self)ifblock_given?selfend |
Fetch all the properties and their values
Returns:
81828384858687 | # File 'lib/github_api/api/config.rb', line 81deffetch(value=nil)ifvalueself.class.property_set[value]elseself.class.property_set.to_hashendend |
686970 | # File 'lib/github_api/api/config.rb', line 68defproperty_namesself.class.property_set.properties.map(&:name)end |