Class: WEEL::Position

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

Overview

}}}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

:at or :after or :unmark



365
366
367
368
369
370
# File 'lib/weel.rb', line 365

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

Instance Attribute Details

#detailObject

Returns the value of attribute detail.



364
365
366
# File 'lib/weel.rb', line 364

def detail
  @detail
end

#passthroughObject

Returns the value of attribute passthrough.



364
365
366
# File 'lib/weel.rb', line 364

def passthrough
  @passthrough
end

#positionObject (readonly)

{{{



363
364
365
# File 'lib/weel.rb', line 363

def position
  @position
end

#uuidObject (readonly)

{{{



363
364
365
# File 'lib/weel.rb', line 363

def uuid
  @uuid
end

Instance Method Details

#as_jsonObject



371
372
373
374
375
# File 'lib/weel.rb', line 371

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


382
383
384
# File 'lib/weel.rb', line 382

def eql?(other)
  to_s == other.to_s
end

#hashObject



385
386
387
# File 'lib/weel.rb', line 385

def hash
  to_s.hash
end

#to_json(*args) ⇒ Object



379
380
381
# File 'lib/weel.rb', line 379

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

#to_sObject



376
377
378
# File 'lib/weel.rb', line 376

def to_s
  as_json.to_s
end