Class: Pine::Content
- Inherits:
-
Object
- Object
- Pine::Content
- Defined in:
- lib/sansom/pine.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#map ⇒ Object
readonly
Returns the value of attribute map.
Instance Method Summary collapse
-
#initialize ⇒ Content
constructor
A new instance of Content.
- #set(k, v) ⇒ Object
Constructor Details
#initialize ⇒ Content
Returns a new instance of Content.
11 12 13 14 |
# File 'lib/sansom/pine.rb', line 11 def initialize @items = [] @map = {} end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
9 10 11 |
# File 'lib/sansom/pine.rb', line 9 def items @items end |
#map ⇒ Object (readonly)
Returns the value of attribute map.
9 10 11 |
# File 'lib/sansom/pine.rb', line 9 def map @map end |
Instance Method Details
#set(k, v) ⇒ Object
16 17 18 19 |
# File 'lib/sansom/pine.rb', line 16 def set k,v @items << v if k == :map @map[k] = v unless k == :map end |