Class: Oat::Props

Inherits:
Object
  • Object
show all
Defined in:
lib/oat/props.rb

Instance Method Summary collapse

Constructor Details

#initializeProps

Returns a new instance of Props.


4
5
6
# File 'lib/oat/props.rb', line 4

def initialize
  @attributes = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, value) ⇒ Object


16
17
18
# File 'lib/oat/props.rb', line 16

def method_missing(name, value)
  @attributes[name] = value
end

Instance Method Details

#_from(data) ⇒ Object


12
13
14
# File 'lib/oat/props.rb', line 12

def _from(data)
  @attributes = data.to_hash
end

#id(value) ⇒ Object


8
9
10
# File 'lib/oat/props.rb', line 8

def id(value)
  @attributes[:id] = value
end

#to_hashObject


20
21
22
# File 'lib/oat/props.rb', line 20

def to_hash
  @attributes
end