Class: Sunnytrail::Event
- Inherits:
-
Hashie::Dash
- Object
- Hashie::Dash
- Sunnytrail::Event
- Defined in:
- lib/sunnytrail.rb
Defined Under Namespace
Instance Attribute Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object
115 116 117 |
# File 'lib/sunnytrail.rb', line 115 def action @action ||= Action.new end |
#plan ⇒ Object
119 120 121 |
# File 'lib/sunnytrail.rb', line 119 def plan @plan ||= Plan.new end |
Instance Method Details
#to_hash ⇒ Object
123 124 125 126 127 128 129 130 131 |
# File 'lib/sunnytrail.rb', line 123 def to_hash out = {} out["action"] = @action.nil? ? {} : @action.to_hash out["plan"] = @plan.nil? ? {} : @plan.to_hash keys.each do |k| out[k] = Hashie::Hash === self[k] ? self[k].to_hash : self[k] end out end |
#to_json ⇒ Object
133 134 135 |
# File 'lib/sunnytrail.rb', line 133 def to_json to_hash.to_json end |