Class: Fleakr::Api::SimpleOption

Inherits:
Object
  • Object
show all
Defined in:
lib/fleakr/api/option.rb

Overview

SimpleOption

Simple name / value option pair

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#typeObject (readonly)

Returns the value of attribute type.



37
38
39
# File 'lib/fleakr/api/option.rb', line 37

def type
  @type
end

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

Generate hash representation of this option



48
49
50
# File 'lib/fleakr/api/option.rb', line 48

def to_hash
  {type => value}
end