Class: Githu3::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/githu3/store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/githu3/store.rb', line 4

def id
  @id
end