Class: Resource
- Defined in:
- lib/Appolo/Models/secondary/resource.rb
Constant Summary collapse
- @@type_of_links =
'resources'
Instance Attribute Summary collapse
-
#class_id ⇒ Object
readonly
Returns the value of attribute class_id.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(json_str) ⇒ Resource
constructor
A new instance of Resource.
- #to_s ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(json_str) ⇒ Resource
Returns a new instance of Resource.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/Appolo/Models/secondary/resource.rb', line 10 def initialize(json_str) json_data = check_json_info json_str super(json_data[ModelUtils::ID], nil, json_data[ModelUtils::LINKS], @@type_of_links) @description = json_data[ModelUtils::DESCRIPTION] @class_id = json_data[ModelUtils::CLASS_ID] @title = json_data[ModelUtils::TITLE] end |
Instance Attribute Details
#class_id ⇒ Object (readonly)
Returns the value of attribute class_id.
8 9 10 |
# File 'lib/Appolo/Models/secondary/resource.rb', line 8 def class_id @class_id end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/Appolo/Models/secondary/resource.rb', line 8 def description @description end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/Appolo/Models/secondary/resource.rb', line 8 def title @title end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/Appolo/Models/secondary/resource.rb', line 23 def to_s "Resource : #{@class_id} - #{@title}" end |