Class: Hyraft::Source
- Inherits:
-
Object
- Object
- Hyraft::Source
- Defined in:
- lib/hyraft/engine/source.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Source
constructor
A new instance of Source.
- #persisted? ⇒ Boolean
- #to_hash ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Source
Returns a new instance of Source.
7 8 9 |
# File 'lib/hyraft/engine/source.rb', line 7 def initialize(attributes = {}) @id = attributes[:id] end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/hyraft/engine/source.rb', line 5 def id @id end |
Instance Method Details
#persisted? ⇒ Boolean
15 16 17 |
# File 'lib/hyraft/engine/source.rb', line 15 def persisted? !@id.nil? end |
#to_hash ⇒ Object
11 12 13 |
# File 'lib/hyraft/engine/source.rb', line 11 def to_hash { id: @id } end |