Class: Githu3::Store
- Inherits:
-
Object
- Object
- Githu3::Store
- Defined in:
- lib/githu3/store.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(data) ⇒ Store
constructor
A new instance of Store.
- #method_missing(m, *args) ⇒ Object
Constructor Details
#initialize(data) ⇒ Store
Returns a new instance of Store.
6 7 8 9 |
# File 'lib/githu3/store.rb', line 6 def initialize data @id = data[:id] || data["id"] @attributes = OpenStruct.new(data) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
11 12 13 |
# File 'lib/githu3/store.rb', line 11 def method_missing m, *args @attributes.send m, *args end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/githu3/store.rb', line 4 def id @id end |