Class: Fountain::Funnel
- Inherits:
-
Object
- Object
- Fountain::Funnel
- Defined in:
- lib/fountain/funnel.rb
Overview
Fountain Funnel
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
readonly
Raw funnel data.
Instance Method Summary collapse
-
#active? ⇒ Boolean
Active.
-
#address ⇒ Object
Address.
-
#custom_id ⇒ Object
Custom ID.
-
#description ⇒ Object
Description.
-
#fields ⇒ Object
Fields.
-
#id ⇒ Object
Funnel ID.
-
#initialize(data) ⇒ Funnel
constructor
A new instance of Funnel.
- #inspect ⇒ Object
-
#location ⇒ Object
Location.
-
#private? ⇒ Boolean
Private.
-
#requirements ⇒ Object
Requirements.
-
#stages ⇒ Object
Stages.
-
#time_zone ⇒ Object
Time zone.
-
#title ⇒ Object
Title.
Constructor Details
#initialize(data) ⇒ Funnel
Returns a new instance of Funnel.
14 15 16 |
# File 'lib/fountain/funnel.rb', line 14 def initialize(data) @raw_data = Util.stringify_hash_keys data end |
Instance Attribute Details
#raw_data ⇒ Object (readonly)
Raw funnel data
9 10 11 |
# File 'lib/fountain/funnel.rb', line 9 def raw_data @raw_data end |
Instance Method Details
#active? ⇒ Boolean
Active
73 74 75 |
# File 'lib/fountain/funnel.rb', line 73 def active? raw_data['active'] end |
#address ⇒ Object
Address
34 35 36 |
# File 'lib/fountain/funnel.rb', line 34 def address raw_data['address'] end |
#custom_id ⇒ Object
Custom ID
29 30 31 |
# File 'lib/fountain/funnel.rb', line 29 def custom_id raw_data['custom_id'] end |
#description ⇒ Object
Description
44 45 46 |
# File 'lib/fountain/funnel.rb', line 44 def description raw_data['description'] end |
#fields ⇒ Object
Fields
54 55 56 57 58 |
# File 'lib/fountain/funnel.rb', line 54 def fields return [] unless raw_data['fields'].is_a? Array raw_data['fields'].map { |hash| Field.new hash } end |
#id ⇒ Object
Funnel ID
19 20 21 |
# File 'lib/fountain/funnel.rb', line 19 def id raw_data['id'] end |
#inspect ⇒ Object
84 85 86 87 88 89 90 91 92 |
# File 'lib/fountain/funnel.rb', line 84 def inspect format( '#<%<class_name>s:0x%<object_id>p @id="%<id>s" @title="%<title>s">', class_name: self.class.name, object_id: object_id, id: id, title: title ) end |
#location ⇒ Object
Location
78 79 80 81 82 |
# File 'lib/fountain/funnel.rb', line 78 def location return unless raw_data['location'].is_a? Hash Location.new raw_data['location'] end |
#private? ⇒ Boolean
Private
68 69 70 |
# File 'lib/fountain/funnel.rb', line 68 def private? raw_data['is_private'] end |
#requirements ⇒ Object
Requirements
49 50 51 |
# File 'lib/fountain/funnel.rb', line 49 def requirements raw_data['requirements'] end |
#stages ⇒ Object
Stages
61 62 63 64 65 |
# File 'lib/fountain/funnel.rb', line 61 def stages return [] unless raw_data['stages'].is_a? Array raw_data['stages'].map { |hash| Stage.new hash } end |
#time_zone ⇒ Object
Time zone
39 40 41 |
# File 'lib/fountain/funnel.rb', line 39 def time_zone raw_data['time_zone'] end |
#title ⇒ Object
Title
24 25 26 |
# File 'lib/fountain/funnel.rb', line 24 def title raw_data['title'] end |