Class: Almanack::Representation::JSONFeed
- Inherits:
-
Object
- Object
- Almanack::Representation::JSONFeed
- Defined in:
- lib/almanack/representation/json_feed.rb
Instance Attribute Summary collapse
-
#calendar ⇒ Object
readonly
Returns the value of attribute calendar.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(calendar) ⇒ JSONFeed
constructor
A new instance of JSONFeed.
- #to_s ⇒ Object
Constructor Details
#initialize(calendar) ⇒ JSONFeed
Returns a new instance of JSONFeed.
6 7 8 |
# File 'lib/almanack/representation/json_feed.rb', line 6 def initialize(calendar) @calendar = calendar end |
Instance Attribute Details
#calendar ⇒ Object (readonly)
Returns the value of attribute calendar.
4 5 6 |
# File 'lib/almanack/representation/json_feed.rb', line 4 def calendar @calendar end |
Class Method Details
.from(calendar) ⇒ Object
16 17 18 |
# File 'lib/almanack/representation/json_feed.rb', line 16 def self.from(calendar) self.new(calendar) end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 |
# File 'lib/almanack/representation/json_feed.rb', line 10 def to_s json_friendly = SerializedTransformation.new(serialized) json_friendly.key { |key| camelize(key.to_s) } json_friendly.apply.to_json end |