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