Class: EurekaBot::Tg::Controller::RepliesConcern::Markup
- Inherits:
-
Object
- Object
- EurekaBot::Tg::Controller::RepliesConcern::Markup
- Defined in:
- lib/eureka_bot/tg/controller/concerns/replies_concern.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(context, options = {}) ⇒ Markup
constructor
A new instance of Markup.
- #method_missing(symbol, *args) ⇒ Object
- #run(&block) ⇒ Object
Constructor Details
#initialize(context, options = {}) ⇒ Markup
Returns a new instance of Markup.
28 29 30 31 32 |
# File 'lib/eureka_bot/tg/controller/concerns/replies_concern.rb', line 28 def initialize(context, ={}) @context = context @options = @items = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/eureka_bot/tg/controller/concerns/replies_concern.rb', line 38 def method_missing(symbol, *args) if context.respond_to?(symbol) context.send(symbol, *args) else super end end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
26 27 28 |
# File 'lib/eureka_bot/tg/controller/concerns/replies_concern.rb', line 26 def context @context end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
26 27 28 |
# File 'lib/eureka_bot/tg/controller/concerns/replies_concern.rb', line 26 def items @items end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
26 27 28 |
# File 'lib/eureka_bot/tg/controller/concerns/replies_concern.rb', line 26 def @options end |
Instance Method Details
#run(&block) ⇒ Object
34 35 36 |
# File 'lib/eureka_bot/tg/controller/concerns/replies_concern.rb', line 34 def run(&block) @items = block.call(self) end |