Class: Shokkenki::Consumer::Model::Role

Inherits:
Object
  • Object
show all
Includes:
Simplification
Defined in:
lib/shokkenki/consumer/model/role.rb

Direct Known Subclasses

Provider

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Simplification

#simplify

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

#labelObject (readonly)

Returns the value of attribute label.



10
11
12
# File 'lib/shokkenki/consumer/model/role.rb', line 10

def label
  @label
end

#nameObject (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_hashObject



17
18
19
20
21
22
# File 'lib/shokkenki/consumer/model/role.rb', line 17

def to_hash
  {
    :name => @name,
    :label => @label
  }
end