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



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

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.



374
375
376
# File 'lib/weel.rb', line 374

def detail
  @detail
end

#passthroughObject

Returns the value of attribute passthrough.



374
375
376
# File 'lib/weel.rb', line 374

def passthrough
  @passthrough
end

#positionObject (readonly)

{{{



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

def position
  @position
end

#uuidObject (readonly)

{{{



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

def uuid
  @uuid
end

Instance Method Details

#as_jsonObject



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

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


392
393
394
# File 'lib/weel.rb', line 392

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

#hashObject



395
396
397
# File 'lib/weel.rb', line 395

def hash
  to_s.hash
end

#to_json(*args) ⇒ Object



389
390
391
# File 'lib/weel.rb', line 389

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

#to_sObject



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

def to_s
  as_json.to_s
end