Class: Megam::Mixins::Repo

Inherits:
Object
  • Object
show all
Includes:
Nilavu::MegamAttributes
Defined in:
lib/megam/mixins/components.rb

Constant Summary collapse

ATTRIBUTES =
[
:type,
:source,
:oneclick,
:url]

Constants included from Nilavu::MegamAttributes

Nilavu::MegamAttributes::KEY, Nilavu::MegamAttributes::VALUE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Nilavu::MegamAttributes

#set_attributes, #to_hash

Constructor Details

#initialize(params) ⇒ Repo

Returns a new instance of Repo.



93
94
95
96
97
98
99
# File 'lib/megam/mixins/components.rb', line 93

def initialize(params)
  set_attributes(params)
  @type = params[:type] || ""
  @source = params[:scm_name] || ""
  @url = params[:source] || ""
  @oneclick = params[:oneclick] || ""
end

Instance Attribute Details

#oneclickObject (readonly)

Returns the value of attribute oneclick.



82
83
84
# File 'lib/megam/mixins/components.rb', line 82

def oneclick
  @oneclick
end

#sourceObject (readonly)

Returns the value of attribute source.



82
83
84
# File 'lib/megam/mixins/components.rb', line 82

def source
  @source
end

#typeObject (readonly)

Returns the value of attribute type.



82
83
84
# File 'lib/megam/mixins/components.rb', line 82

def type
  @type
end

#urlObject (readonly)

Returns the value of attribute url.



82
83
84
# File 'lib/megam/mixins/components.rb', line 82

def url
  @url
end

Instance Method Details

#attributesObject



89
90
91
# File 'lib/megam/mixins/components.rb', line 89

def attributes
  ATTRIBUTES
end

#tohashObject



101
102
103
104
105
106
107
# File 'lib/megam/mixins/components.rb', line 101

def tohash
  {  rtype: @type,
     source: @source,
     oneclick: @oneclick,
     url: @url
  }
end