Module: AskAwesomely::DSL

Defined in:
lib/ask_awesomely/dsl.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



61
62
63
# File 'lib/ask_awesomely/dsl.rb', line 61

def context
  @context
end

#jsonObject (readonly)

Returns the value of attribute json.



61
62
63
# File 'lib/ask_awesomely/dsl.rb', line 61

def json
  @json
end

#stateObject (readonly)

Returns the value of attribute state.



61
62
63
# File 'lib/ask_awesomely/dsl.rb', line 61

def state
  @state
end

Class Method Details

.included(recv) ⇒ Object



4
5
6
7
# File 'lib/ask_awesomely/dsl.rb', line 4

def self.included(recv)
  recv.extend(ClassMethods)
  recv.include(JsonBuilder)
end

Instance Method Details

#to_jsonObject



63
64
65
66
# File 'lib/ask_awesomely/dsl.rb', line 63

def to_json
  warn_if_no_webhook_set
  build_json(context).to_json
end