Class: Nice::DataGouv::Resource
- Inherits:
-
Object
- Object
- Nice::DataGouv::Resource
- Defined in:
- lib/nice/data_gouv/resource.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Resource
constructor
A new instance of Resource.
- #to_h ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Resource
Returns a new instance of Resource.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/nice/data_gouv/resource.rb', line 6 def initialize(attributes = {}) @id = attributes['id'] @name = attributes['name'] @description = attributes['description'] @url = attributes['url'] @format = attributes['format'] @size = attributes['size'] @created_at = attributes['created'] @last_modified = attributes['last_modified'] end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/nice/data_gouv/resource.rb', line 4 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/nice/data_gouv/resource.rb', line 4 def description @description end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
4 5 6 |
# File 'lib/nice/data_gouv/resource.rb', line 4 def format @format end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/nice/data_gouv/resource.rb', line 4 def id @id end |
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified.
4 5 6 |
# File 'lib/nice/data_gouv/resource.rb', line 4 def last_modified @last_modified end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/nice/data_gouv/resource.rb', line 4 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
4 5 6 |
# File 'lib/nice/data_gouv/resource.rb', line 4 def size @size end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/nice/data_gouv/resource.rb', line 4 def url @url end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/nice/data_gouv/resource.rb', line 17 def to_h { 'id' => @id, 'name' => @name, 'description' => @description, 'url' => @url, 'format' => @format, 'size' => @size, 'created_at' => @created_at, 'last_modified' => @last_modified } end |