Class: Rawscsi::Stringifier::Compound

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Encode

#encode

Constructor Details

#initialize(bool_hash) ⇒ Compound

Returns a new instance of Compound.



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

def initialize(bool_hash)
  @bool_hash = bool_hash
end

Instance Attribute Details

#bool_hashObject (readonly)

Returns the value of attribute bool_hash.



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

def bool_hash
  @bool_hash
end

Instance Method Details

#buildObject



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

def build
  bool_op = bool_hash.keys.first
  ar = bool_hash[bool_op]
  "(#{bool_op}" + encode(" #{bool_map(ar)}") + ")"
end