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
#[], #[]=, add_instantiation_name_list, #destroy, friendly_attributes, #id, #initialize, instantiation?, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, map_attributes_to_time, #to_hash, #update
#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 ⇒ Date
8
9
10
|
# File 'lib/yao/resources/sample.rb', line 8
def recorded_at
Time.parse(self["recorded_at"])
end
|
18
19
20
|
# File 'lib/yao/resources/sample.rb', line 18
def resource
@resource ||= Yao::Resource.get(resource_id)
end
|
#timestamp ⇒ Date
13
14
15
|
# File 'lib/yao/resources/sample.rb', line 13
def timestamp
Time.parse(self["timestamp"])
end
|
23
24
25
|
# File 'lib/yao/resources/sample.rb', line 23
def user
@user ||= Yao::User.get(user_id)
end
|