Class: Mixpal::Snippet
- Inherits:
-
Object
- Object
- Mixpal::Snippet
- Defined in:
- lib/mixpal/snippet.rb
Instance Attribute Summary collapse
-
#snippet ⇒ Object
readonly
Returns the value of attribute snippet.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(snippet) ⇒ Snippet
constructor
A new instance of Snippet.
- #render ⇒ Object
- #to_store ⇒ Object
Constructor Details
#initialize(snippet) ⇒ Snippet
Returns a new instance of Snippet.
5 6 7 |
# File 'lib/mixpal/snippet.rb', line 5 def initialize(snippet) @snippet = snippet end |
Instance Attribute Details
#snippet ⇒ Object (readonly)
Returns the value of attribute snippet.
3 4 5 |
# File 'lib/mixpal/snippet.rb', line 3 def snippet @snippet end |
Class Method Details
.from_store(data) ⇒ Object
19 20 21 |
# File 'lib/mixpal/snippet.rb', line 19 def self.from_store(data) new(data['snippet']) end |
Instance Method Details
#render ⇒ Object
9 10 11 |
# File 'lib/mixpal/snippet.rb', line 9 def render snippet.html_safe end |
#to_store ⇒ Object
13 14 15 16 17 |
# File 'lib/mixpal/snippet.rb', line 13 def to_store { 'snippet' => snippet } end |