Class: Emfrp::Link
- Inherits:
-
Object
- Object
- Emfrp::Link
- Defined in:
- lib/emfrp/syntax.rb
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #get ⇒ Object
- #hash ⇒ Object
-
#initialize(syntax, name = nil) ⇒ Link
constructor
A new instance of Link.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(syntax, name = nil) ⇒ Link
Returns a new instance of Link.
42 43 44 45 |
# File 'lib/emfrp/syntax.rb', line 42 def initialize(syntax, name=nil) @link = syntax @name = name end |
Instance Method Details
#eql?(other) ⇒ Boolean
55 56 57 |
# File 'lib/emfrp/syntax.rb', line 55 def eql?(other) self.hash == other.hash end |
#get ⇒ Object
47 48 49 |
# File 'lib/emfrp/syntax.rb', line 47 def get @link end |
#hash ⇒ Object
51 52 53 |
# File 'lib/emfrp/syntax.rb', line 51 def hash @link.object_id end |
#inspect ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/emfrp/syntax.rb', line 59 def inspect if @name || @link.has_key?(:name) "Link(#{@name || @link[:name][:desc]} : #{@link.class})" else "Link(#{@link.class})" end end |
#to_s ⇒ Object
67 68 69 |
# File 'lib/emfrp/syntax.rb', line 67 def to_s inspect end |