Class: Nice::DataGouv::Organization
- Inherits:
-
Object
- Object
- Nice::DataGouv::Organization
- Defined in:
- lib/nice/data_gouv/organization.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.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Organization
constructor
A new instance of Organization.
- #to_h ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Organization
Returns a new instance of Organization.
6 7 8 9 10 11 12 13 14 |
# File 'lib/nice/data_gouv/organization.rb', line 6 def initialize(attributes = {}) @id = attributes['id'] @name = attributes['name'] @slug = attributes['slug'] @title = attributes['title'] || attributes['display_name'] || attributes['name'] @description = attributes['description'] @image_url = attributes['logo'] || attributes['image_url'] || attributes['image_display_url'] @created_at = attributes['created_at'] || attributes['created'] end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/nice/data_gouv/organization.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/organization.rb', line 4 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/nice/data_gouv/organization.rb', line 4 def id @id end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
4 5 6 |
# File 'lib/nice/data_gouv/organization.rb', line 4 def image_url @image_url end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/nice/data_gouv/organization.rb', line 4 def name @name end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
4 5 6 |
# File 'lib/nice/data_gouv/organization.rb', line 4 def slug @slug end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/nice/data_gouv/organization.rb', line 4 def title @title end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/nice/data_gouv/organization.rb', line 16 def to_h { 'id' => @id, 'name' => @name, 'slug' => @slug, 'title' => @title, 'description' => @description, 'image_url' => @image_url, 'created_at' => @created_at } end |