Class: Rawscsi::Stringifier::Simple

Inherits:
Object
  • Object
show all
Includes:
Encode
Defined in:
lib/rawscsi/stringifier/simple.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Encode

#encode

Constructor Details

#initialize(value) ⇒ Simple

Returns a new instance of Simple.



8
9
10
# File 'lib/rawscsi/stringifier/simple.rb', line 8

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6
7
8
# File 'lib/rawscsi/stringifier/simple.rb', line 6

def value
  @value
end

Instance Method Details

#buildObject



12
13
14
15
16
17
18
# File 'lib/rawscsi/stringifier/simple.rb', line 12

def build
  if value.kind_of?(Hash)
    build_from_hash(value)
  else
    encode(stringify(value))
  end
end