Class: Spout::Models::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/spout/models/option.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(option_hash) ⇒ Option

Returns a new instance of Option.



8
9
10
11
12
# File 'lib/spout/models/option.rb', line 8

def initialize(option_hash)
  %w(display_name value description missing).each do |method|
    instance_variable_set("@#{method}", (option_hash.is_a?(Hash) ? option_hash : {})[method])
  end
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/spout/models/option.rb', line 6

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name.



6
7
8
# File 'lib/spout/models/option.rb', line 6

def display_name
  @display_name
end

#missingObject

Returns the value of attribute missing.



6
7
8
# File 'lib/spout/models/option.rb', line 6

def missing
  @missing
end

#valueObject

Returns the value of attribute value.



6
7
8
# File 'lib/spout/models/option.rb', line 6

def value
  @value
end

Instance Method Details

#deploy_paramsObject



14
15
16
17
# File 'lib/spout/models/option.rb', line 14

def deploy_params
  { display_name: display_name, value: value, description: description,
    missing: missing }
end