Class: TypeStation::DSL::Page
- Inherits:
-
Object
- Object
- TypeStation::DSL::Page
- Defined in:
- lib/type_station/dsl.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
- #call(&block) ⇒ Object
-
#initialize(title, options = {}, parent = nil) ⇒ Page
constructor
A new instance of Page.
- #page(name, options = {}, &block) ⇒ Object
Constructor Details
#initialize(title, options = {}, parent = nil) ⇒ Page
Returns a new instance of Page.
10 11 12 13 14 15 |
# File 'lib/type_station/dsl.rb', line 10 def initialize(title, = {}, parent = nil) @title = title @options = @parent = parent @model = _build_model(@title, @options, @parent) end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
9 10 11 |
# File 'lib/type_station/dsl.rb', line 9 def model @model end |
Instance Method Details
#call(&block) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/type_station/dsl.rb', line 17 def call(&block) if block_given? if block.arity == 1 block.call model else instance_eval &block end end model end |