Class: Bookit::Content::Generic
- Inherits:
-
Object
- Object
- Bookit::Content::Generic
- Defined in:
- lib/bookit/content/generic.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Generic
constructor
Content can always take options.
-
#is_type?(sym) ⇒ Boolean
returns true if this symbol is tied to the class type.
-
#render ⇒ Object
#render for any Content object should always return a string it is also possible to pass a block to render actions so that you can fine-tune the content output from your Emitters.
-
#type ⇒ Object
gives us an easy to compare type symbol.
Constructor Details
#initialize(options = {}) ⇒ Generic
Content can always take options. These can usually be used to add additional formatting information for the Emitters
7 8 9 |
# File 'lib/bookit/content/generic.rb', line 7 def initialize(={}) @attributes = end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/bookit/content/generic.rb', line 3 def attributes @attributes end |
Instance Method Details
#is_type?(sym) ⇒ Boolean
returns true if this symbol is tied to the class type
24 25 26 |
# File 'lib/bookit/content/generic.rb', line 24 def is_type? sym self.class == Content::TYPES[sym] end |
#render ⇒ Object
#render for any Content object should always return a string it is also possible to pass a block to render actions so that you can fine-tune the content output from your Emitters
14 15 16 |
# File 'lib/bookit/content/generic.rb', line 14 def render inspect end |
#type ⇒ Object
gives us an easy to compare type symbol
19 20 21 |
# File 'lib/bookit/content/generic.rb', line 19 def type self.class.to_s.split('::').last.downcase.to_sym end |