Class: Yeti::Viewer
- Inherits:
-
Object
- Object
- Yeti::Viewer
- Defined in:
- lib/yeti/viewer.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#decorated ⇒ Object
readonly
Returns the value of attribute decorated.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(context, decorated) ⇒ Viewer
constructor
A new instance of Viewer.
Constructor Details
#initialize(context, decorated) ⇒ Viewer
Returns a new instance of Viewer.
7 8 9 10 |
# File 'lib/yeti/viewer.rb', line 7 def initialize(context, decorated) @context = context @decorated = decorated end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
4 5 6 |
# File 'lib/yeti/viewer.rb', line 4 def context @context end |
#decorated ⇒ Object (readonly)
Returns the value of attribute decorated.
4 5 6 |
# File 'lib/yeti/viewer.rb', line 4 def decorated @decorated end |
Class Method Details
.from_id(context, id) ⇒ Object
12 13 14 |
# File 'lib/yeti/viewer.rb', line 12 def self.from_id(context, id) new context, (find_by_id context, id if id) end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
16 17 18 |
# File 'lib/yeti/viewer.rb', line 16 def ==(other) other.equal?(self) || (other.instance_of?(self.class) && other.id==id) end |
#hash ⇒ Object
21 22 23 |
# File 'lib/yeti/viewer.rb', line 21 def hash id.hash end |