Class: Edoors::Link
- Inherits:
-
Object
- Object
- Edoors::Link
- Defined in:
- lib/edoors/link.rb
Instance Attribute Summary collapse
-
#door ⇒ Object
Returns the value of attribute door.
-
#dsts ⇒ Object
readonly
Returns the value of attribute dsts.
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
-
#src ⇒ Object
readonly
Returns the value of attribute src.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
-
.from_particle(p) ⇒ Object
creates a Link object from the data of a particle.
-
.json_create(o) ⇒ Object
creates a Link object from a JSON data.
Instance Method Summary collapse
-
#initialize(src, dsts, keys = nil, value = nil) ⇒ Link
constructor
creates a Link object from the arguments.
-
#to_json(*a) ⇒ Object
called by JSON#generate to serialize the Link object into JSON data.
Constructor Details
#initialize(src, dsts, keys = nil, value = nil) ⇒ Link
creates a Link object from the arguments.
41 42 43 44 45 46 47 |
# File 'lib/edoors/link.rb', line 41 def initialize src, dsts, keys=nil, value=nil @src = src @dsts = dsts @keys = keys @value = value @door = nil # pointer to the source set from @src by Room#add_link end |
Instance Attribute Details
#door ⇒ Object
Returns the value of attribute door.
83 84 85 |
# File 'lib/edoors/link.rb', line 83 def door @door end |
#dsts ⇒ Object (readonly)
Returns the value of attribute dsts.
84 85 86 |
# File 'lib/edoors/link.rb', line 84 def dsts @dsts end |
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
84 85 86 |
# File 'lib/edoors/link.rb', line 84 def keys @keys end |
#src ⇒ Object (readonly)
Returns the value of attribute src.
84 85 86 |
# File 'lib/edoors/link.rb', line 84 def src @src end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
84 85 86 |
# File 'lib/edoors/link.rb', line 84 def value @value end |
Class Method Details
Instance Method Details
#to_json(*a) ⇒ Object
called by JSON#generate to serialize the Link object into JSON data
53 54 55 56 57 58 59 60 61 |
# File 'lib/edoors/link.rb', line 53 def to_json *a { 'kls' => self.class.name, 'src' => @src, 'dsts' => @dsts, 'keys' => @keys, 'value' => @value }.to_json *a end |