Class: Shokkenki::Consumer::Model::Role
- Inherits:
-
Object
- Object
- Shokkenki::Consumer::Model::Role
- Includes:
- Simplification
- Defined in:
- lib/shokkenki/consumer/model/role.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(arguments) ⇒ Role
constructor
A new instance of Role.
- #to_hash ⇒ Object
Methods included from Simplification
Constructor Details
#initialize(arguments) ⇒ Role
Returns a new instance of Role.
12 13 14 15 |
# File 'lib/shokkenki/consumer/model/role.rb', line 12 def initialize arguments @name = simplify(arguments[:name]) @label = arguments[:label] || @name.to_s.titleize end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
10 11 12 |
# File 'lib/shokkenki/consumer/model/role.rb', line 10 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/shokkenki/consumer/model/role.rb', line 10 def name @name end |
Instance Method Details
#to_hash ⇒ Object
17 18 19 20 21 22 |
# File 'lib/shokkenki/consumer/model/role.rb', line 17 def to_hash { :name => @name, :label => @label } end |