Class: WEEL::Position

Inherits:
Object show all
Defined in:
lib/weel.rb

Overview

}}}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(position, detail = :at, passthrough = nil) ⇒ Position

:at or :after or :unmark



255
256
257
258
259
# File 'lib/weel.rb', line 255

def initialize(position, detail=:at, passthrough=nil) # :at or :after or :unmark
  @position = position
  @detail = detail
  @passthrough = passthrough
end

Instance Attribute Details

#detailObject

Returns the value of attribute detail.



254
255
256
# File 'lib/weel.rb', line 254

def detail
  @detail
end

#passthroughObject

Returns the value of attribute passthrough.



254
255
256
# File 'lib/weel.rb', line 254

def passthrough
  @passthrough
end

#positionObject (readonly)

{{{



253
254
255
# File 'lib/weel.rb', line 253

def position
  @position
end

Instance Method Details

#as_jsonObject



260
261
262
263
264
# File 'lib/weel.rb', line 260

def as_json(*)
  jsn = { 'position' => @position }
  jsn['passtrough'] = @passthrough if @passthrough
  jsn
end

#to_json(*args) ⇒ Object



268
269
270
# File 'lib/weel.rb', line 268

def to_json(*args)
  as_json.to_json(*args)
end

#to_sObject



265
266
267
# File 'lib/weel.rb', line 265

def to_s
  as_json.to_s
end