Class: Factrey::Ref
- Inherits:
-
Object
- Object
- Factrey::Ref
- Defined in:
- lib/factrey/ref.rb,
lib/factrey/ref/defer.rb,
lib/factrey/ref/builder.rb,
lib/factrey/ref/resolver.rb,
lib/factrey/ref/shorthand_methods.rb
Overview
Represents a reference that can be embedded in the data and resolved later.
Refs and Defers are usually created through ShorthandMethods#ref.
Defined Under Namespace
Modules: ShorthandMethods Classes: Builder, Defer, Resolver
Instance Attribute Summary collapse
- #name ⇒ Symbol readonly
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(name) ⇒ Ref
constructor
A new instance of Ref.
Constructor Details
#initialize(name) ⇒ Ref
Returns a new instance of Ref.
28 29 30 31 32 |
# File 'lib/factrey/ref.rb', line 28 def initialize(name) raise TypeError, "name must be a Symbol" unless name.is_a?(Symbol) @name = name end |
Instance Attribute Details
#name ⇒ Symbol (readonly)
25 26 27 |
# File 'lib/factrey/ref.rb', line 25 def name @name end |
Instance Method Details
#==(other) ⇒ Object
34 |
# File 'lib/factrey/ref.rb', line 34 def ==(other) = other.is_a?(Ref) && other.name == name |
#eql?(other) ⇒ Boolean
36 |
# File 'lib/factrey/ref.rb', line 36 def eql?(other) = self == other |
#hash ⇒ Object
38 |
# File 'lib/factrey/ref.rb', line 38 def hash = name.hash |