Class: Arpa::Entities::Action
- Inherits:
-
Object
- Object
- Arpa::Entities::Action
- Defined in:
- lib/arpa/entities/action.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#resource_id ⇒ Object
readonly
Returns the value of attribute resource_id.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(attrs = {}) ⇒ Action
constructor
A new instance of Action.
- #resource_name ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Action
Returns a new instance of Action.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/arpa/entities/action.rb', line 6 def initialize(attrs = {}) attrs = attrs.with_indifferent_access @id = attrs[:id] @resource_id = attrs[:resource_id] @resource = attrs[:resource] @name = attrs[:name] @created_at = attrs[:created_at] @updated_at = attrs[:updated_at] end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/arpa/entities/action.rb', line 4 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/arpa/entities/action.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/arpa/entities/action.rb', line 4 def name @name end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
4 5 6 |
# File 'lib/arpa/entities/action.rb', line 4 def resource @resource end |
#resource_id ⇒ Object (readonly)
Returns the value of attribute resource_id.
4 5 6 |
# File 'lib/arpa/entities/action.rb', line 4 def resource_id @resource_id end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/arpa/entities/action.rb', line 4 def updated_at @updated_at end |
Instance Method Details
#description ⇒ Object
22 23 24 |
# File 'lib/arpa/entities/action.rb', line 22 def description I18n.t(name.to_sym, scope: "entities.resources.#{resource_name}.actions.description") end |
#resource_name ⇒ Object
17 18 19 20 |
# File 'lib/arpa/entities/action.rb', line 17 def resource_name return resource.name if resource '' end |