Class: Pendulum::DSL::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/pendulum/dsl/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, &block) ⇒ Result

Returns a new instance of Result.



5
6
7
8
9
# File 'lib/pendulum/dsl/result.rb', line 5

def initialize(type, &block)
  self.type = type
  self.output = output_by(type)
  self.output.instance_eval(&block) if block_given?
end

Instance Attribute Details

#outputObject

Returns the value of attribute output.



3
4
5
# File 'lib/pendulum/dsl/result.rb', line 3

def output
  @output
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/pendulum/dsl/result.rb', line 3

def type
  @type
end

Instance Method Details

#to_urlObject



11
12
13
# File 'lib/pendulum/dsl/result.rb', line 11

def to_url
  output.to_url
end