Class: Yao::Resources::Sample
- Inherits:
-
Base
- Object
- Base
- Yao::Resources::Sample
show all
- Defined in:
- lib/yao/resources/sample.rb
Instance Attribute Summary
#service
Instance Method Summary
collapse
Methods inherited from Base
#[], #[]=, #created, friendly_attributes, #id, #initialize, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, #to_hash, #updated
#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #get, #get!, #list, #resources_path, #resources_path=, #return_single_on_querying, #return_single_on_querying=, #update
Instance Method Details
#recorded_at ⇒ Object
7
8
9
|
# File 'lib/yao/resources/sample.rb', line 7
def recorded_at
Time.parse(self["recorded_at"])
end
|
#resource ⇒ Object
15
16
17
|
# File 'lib/yao/resources/sample.rb', line 15
def resource
@resource ||= Yao::Resource.get(resource_id)
end
|
#timestamp ⇒ Object
11
12
13
|
# File 'lib/yao/resources/sample.rb', line 11
def timestamp
Time.parse(self["timestamp"])
end
|
#user ⇒ Object
19
20
21
|
# File 'lib/yao/resources/sample.rb', line 19
def user
@user ||= Yao::User.get(user_id)
end
|