Class: Sway::Base
Instance Attribute Summary collapse
-
#mash ⇒ Object
readonly
Returns the value of attribute mash.
-
#mashes ⇒ Object
readonly
Returns the value of attribute mashes.
Instance Method Summary collapse
-
#initialize(array_or_hash) ⇒ Base
constructor
A new instance of Base.
Methods included from Mashable
#create_mash_from, #create_mashes_from
Constructor Details
#initialize(array_or_hash) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/sway/base.rb', line 8 def initialize(array_or_hash) case array_or_hash.class.to_s when 'Array' array = array_or_hash @mashes = create_mashes_from(array) when 'Hash' hash = array_or_hash @mash = create_mash_from(hash) end end |
Instance Attribute Details
#mash ⇒ Object (readonly)
Returns the value of attribute mash.
6 7 8 |
# File 'lib/sway/base.rb', line 6 def mash @mash end |
#mashes ⇒ Object (readonly)
Returns the value of attribute mashes.
6 7 8 |
# File 'lib/sway/base.rb', line 6 def mashes @mashes end |