Class: Fortnox::RelationBuilder
- Inherits:
-
Object
- Object
- Fortnox::RelationBuilder
- Defined in:
- lib/fortnox/relation_builder.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(resource, attributes) ⇒ RelationBuilder
constructor
A new instance of RelationBuilder.
Constructor Details
#initialize(resource, attributes) ⇒ RelationBuilder
Returns a new instance of RelationBuilder.
5 6 7 8 |
# File 'lib/fortnox/relation_builder.rb', line 5 def initialize(resource, attributes) @resource = resource @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/fortnox/relation_builder.rb', line 3 def attributes @attributes end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
3 4 5 |
# File 'lib/fortnox/relation_builder.rb', line 3 def resource @resource end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 |
# File 'lib/fortnox/relation_builder.rb', line 10 def call resource.class.relations.each do |relation| build_relation(relation) end end |