Class: FactoryForm::DescriptiveContent

Inherits:
Object
  • Object
show all
Defined in:
lib/factoryform/descriptive_content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ DescriptiveContent

Returns a new instance of DescriptiveContent.



6
7
8
9
10
11
12
# File 'lib/factoryform/descriptive_content.rb', line 6

def initialize(options = {})
  unless options.empty? || options[:id].empty? || options[:label].empty?
    @id, @label, @value = options[:id], options[:label], options[:value] || options[:label]
  else
    raise(ParameterExpectedException, "Missing ID and label")
  end
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/factoryform/descriptive_content.rb', line 3

def id
  @id
end

#labelObject

Returns the value of attribute label.



4
5
6
# File 'lib/factoryform/descriptive_content.rb', line 4

def label
  @label
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/factoryform/descriptive_content.rb', line 4

def value
  @value
end