Class: Fortnox::RelationBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/fortnox/relation_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (readonly)

Returns the value of attribute attributes.



3
4
5
# File 'lib/fortnox/relation_builder.rb', line 3

def attributes
  @attributes
end

#resourceObject (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

#callObject



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