Class: Localwiki::Resource
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Localwiki::Resource
- Defined in:
- lib/localwiki/resource.rb
Overview
simple OpenStruct object to allow attribute access on resources (instead of hash key access)
Instance Attribute Summary collapse
-
#json ⇒ Object
readonly
raw json string used to instanciate object.
Instance Method Summary collapse
-
#initialize(json_hash) ⇒ Resource
constructor
create instance of resource.
Constructor Details
#initialize(json_hash) ⇒ Resource
create instance of resource
25 26 27 28 |
# File 'lib/localwiki/resource.rb', line 25 def initialize json_hash @json = json_hash super end |
Instance Attribute Details
#json ⇒ Object (readonly)
raw json string used to instanciate object
20 21 22 |
# File 'lib/localwiki/resource.rb', line 20 def json @json end |