Class: ButterCMS::Content
- Inherits:
-
Object
- Object
- ButterCMS::Content
- Defined in:
- lib/buttercms/content.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json) ⇒ Content
constructor
A new instance of Content.
- #inspect ⇒ Object
Constructor Details
#initialize(json) ⇒ Content
Returns a new instance of Content.
5 6 7 8 |
# File 'lib/buttercms/content.rb', line 5 def initialize(json) @json = json @data = HashToObject.convert(json["data"]) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/buttercms/content.rb', line 3 def data @data end |
Class Method Details
Instance Method Details
#inspect ⇒ Object
10 11 12 13 |
# File 'lib/buttercms/content.rb', line 10 def inspect id_string = (self.respond_to?(:id) && !self.id.nil?) ? " id=#{self.id}" : "" "#<#{self.class}:0x#{self.object_id.to_s(16)}#{id_string}> JSON: " + JSON.pretty_generate(@json) end |