Class: Jets::Resource::Associated

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Defined in:
lib/jets/resource/associated.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*definition) ⇒ Associated

Returns a new instance of Associated.



8
9
10
# File 'lib/jets/resource/associated.rb', line 8

def initialize(*definition)
  @definition = definition.flatten
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



7
8
9
# File 'lib/jets/resource/associated.rb', line 7

def definition
  @definition
end

Instance Method Details

#attributesObject



16
17
18
# File 'lib/jets/resource/associated.rb', line 16

def attributes
  standardized.values.first
end

#logical_idObject



12
13
14
# File 'lib/jets/resource/associated.rb', line 12

def logical_id
  standardized.keys.first
end

#standardizedObject



20
21
22
23
# File 'lib/jets/resource/associated.rb', line 20

def standardized
  standardizer = Standardizer.new(definition)
  standardizer.standarize(definition) # doesnt camelize keys yet
end