Class: Coach4rb::Resource::Entity
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
included
included
included
Instance Attribute Details
#links ⇒ Object
Returns the value of attribute links.
12
13
14
|
# File 'lib/coach4rb/resource/entity.rb', line 12
def links
@links
end
|
#uri ⇒ Object
Returns the value of attribute uri.
12
13
14
|
# File 'lib/coach4rb/resource/entity.rb', line 12
def uri
@uri
end
|
Class Method Details
.from_coach(param) ⇒ Object
14
15
16
17
18
|
# File 'lib/coach4rb/resource/entity.rb', line 14
def self.from_coach(param)
a_hash = param.dup
a_hash[:links] ||= []
self.new a_hash
end
|
Instance Method Details
#[](key) ⇒ Object
29
30
31
32
33
34
35
36
|
# File 'lib/coach4rb/resource/entity.rb', line 29
def [](key)
case key
when Symbol
super(key)
else
raise 'Error: param not supported!'
end
end
|
#each(&block) ⇒ Object
21
22
23
24
25
26
|
# File 'lib/coach4rb/resource/entity.rb', line 21
def each(&block)
instance_variables.each do |variable|
value = instance_variable_get(variable)
block.call variable, value
end
end
|
#entity_path ⇒ Object
39
40
41
|
# File 'lib/coach4rb/resource/entity.rb', line 39
def entity_path
raise 'Not implemented!'
end
|