Class: FreshBooks::Schema::Definition
- Inherits:
-
Object
- Object
- FreshBooks::Schema::Definition
- Defined in:
- lib/freshbooks/schema/definition.rb
Instance Attribute Summary collapse
-
#members ⇒ Object
readonly
Returns the value of attribute members.
Instance Method Summary collapse
-
#initialize ⇒ Definition
constructor
A new instance of Definition.
- #method_missing(method, *attributes) ⇒ Object
Constructor Details
#initialize ⇒ Definition
Returns a new instance of Definition.
6 7 8 |
# File 'lib/freshbooks/schema/definition.rb', line 6 def initialize @members = ActiveSupport::OrderedHash.new end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *attributes) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/freshbooks/schema/definition.rb', line 10 def method_missing(method, *attributes) = attributes. [:read_only] ||= false attributes.each do |attribute| @members[attribute.to_s] = .merge({ :type => method.to_sym }) end end |
Instance Attribute Details
#members ⇒ Object (readonly)
Returns the value of attribute members.
4 5 6 |
# File 'lib/freshbooks/schema/definition.rb', line 4 def members @members end |