Class: Arpa::Entities::Resource
- Inherits:
-
Object
- Object
- Arpa::Entities::Resource
- Defined in:
- lib/arpa/entities/resource.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #build_correct_name ⇒ Object
-
#initialize(attrs = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(attrs = {}) ⇒ Resource
Returns a new instance of Resource.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/arpa/entities/resource.rb', line 6 def initialize(attrs = {}) attrs = attrs.with_indifferent_access @id = attrs[:id] @full_name = attrs[:full_name] @name = attrs[:name] @created_at = attrs[:created_at] @updated_at = attrs[:updated_at] @actions = attrs[:actions].present? ? attrs[:actions] : [] end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
4 5 6 |
# File 'lib/arpa/entities/resource.rb', line 4 def actions @actions end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/arpa/entities/resource.rb', line 4 def created_at @created_at end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
4 5 6 |
# File 'lib/arpa/entities/resource.rb', line 4 def full_name @full_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/arpa/entities/resource.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/arpa/entities/resource.rb', line 4 def name @name end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/arpa/entities/resource.rb', line 4 def updated_at @updated_at end |
Instance Method Details
#build_correct_name ⇒ Object
17 18 19 20 |
# File 'lib/arpa/entities/resource.rb', line 17 def build_correct_name name = remove_word(full_name) @name = adjust_name(name) end |