Class: Fleakr::Api::SimpleOption
- Inherits:
-
Object
- Object
- Fleakr::Api::SimpleOption
- Defined in:
- lib/fleakr/api/option.rb
Overview
SimpleOption
Simple name / value option pair
Direct Known Subclasses
HiddenOption, LevelOption, TagOption, TypeOption, ViewOption
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type, value) ⇒ SimpleOption
constructor
Create an option of the specified type and value.
-
#to_hash ⇒ Object
Generate hash representation of this option.
Constructor Details
#initialize(type, value) ⇒ SimpleOption
Create an option of the specified type and value
41 42 43 44 |
# File 'lib/fleakr/api/option.rb', line 41 def initialize(type, value) @type = type @value = value end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
37 38 39 |
# File 'lib/fleakr/api/option.rb', line 37 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
37 38 39 |
# File 'lib/fleakr/api/option.rb', line 37 def value @value end |
Instance Method Details
#to_hash ⇒ Object
Generate hash representation of this option
48 49 50 |
# File 'lib/fleakr/api/option.rb', line 48 def to_hash {type => value} end |