Class: Hyraft::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/hyraft/engine/source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject

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

Returns:

  • (Boolean)


15
16
17
# File 'lib/hyraft/engine/source.rb', line 15

def persisted?
  !@id.nil?
end

#to_hashObject



11
12
13
# File 'lib/hyraft/engine/source.rb', line 11

def to_hash
  { id: @id }
end