Class: GoogleApi::Ga::Segment
- Inherits:
-
Management
- Object
- Management
- GoogleApi::Ga::Segment
- Defined in:
- lib/google_api/ga/management/segment.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
Returns the value of attribute definition.
-
#segment_id ⇒ Object
Returns the value of attribute segment_id.
Attributes inherited from Management
#created, #id, #name, #updated
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(segment) ⇒ Segment
constructor
A new instance of Segment.
- #refresh ⇒ Object
Methods inherited from Management
Constructor Details
#initialize(segment) ⇒ Segment
Returns a new instance of Segment.
8 9 10 |
# File 'lib/google_api/ga/management/segment.rb', line 8 def initialize(segment) set(segment) end |
Instance Attribute Details
#definition ⇒ Object
Returns the value of attribute definition.
6 7 8 |
# File 'lib/google_api/ga/management/segment.rb', line 6 def definition @definition end |
#segment_id ⇒ Object
Returns the value of attribute segment_id.
5 6 7 |
# File 'lib/google_api/ga/management/segment.rb', line 5 def segment_id @segment_id end |
Class Method Details
.all(segment_id = '~all') ⇒ Object
12 13 14 |
# File 'lib/google_api/ga/management/segment.rb', line 12 def self.all(segment_id = '~all') get({ segmentId: segment_id }).map { |segment| Segment.new(segment) } end |
.find(segment_id) ⇒ Object
16 17 18 |
# File 'lib/google_api/ga/management/segment.rb', line 16 def self.find(segment_id) all(segment_id).first end |
Instance Method Details
#refresh ⇒ Object
20 21 22 23 24 |
# File 'lib/google_api/ga/management/segment.rb', line 20 def refresh set( Segment.get({ segmentId: @id }).first ) return true end |