Class: Flip::Definition

Inherits:
Object
  • Object
show all
Defined in:
lib/flip/definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, options = {}) ⇒ Definition

Returns a new instance of Definition.



7
8
9
10
11
# File 'lib/flip/definition.rb', line 7

def initialize(key, options = {})
  @key = key
  @options = options.reverse_merge \
    description: key.to_s.humanize + "."
end

Instance Attribute Details

#keyObject Also known as: name, to_s

Returns the value of attribute key.



4
5
6
# File 'lib/flip/definition.rb', line 4

def key
  @key
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/flip/definition.rb', line 5

def options
  @options
end

Instance Method Details

#descriptionObject



16
17
18
# File 'lib/flip/definition.rb', line 16

def description
  options[:description]
end